package de.playmee.dialogs;

import de.playmee.R;
import android.app.Dialog;
import android.content.Context;
import android.view.ViewGroup.LayoutParams;
import android.widget.ProgressBar;

public class ProgressWheelDialog {
	
	// private final String TAG = "ProgressWheelDialog";

	private Context context;
	private Dialog dialog;
	
	public ProgressWheelDialog(Context context) {
		this.context = context;
		create();
	}
	
	/**
	 * creates and initializes the dialog
	 */
	private void create() {
		dialog = new Dialog(context, R.style.SimpleProgressDialog);
		dialog.addContentView(new ProgressBar(context),
				new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
		dialog.setCancelable(false);
	}
	
	/**
	 * shows a progress dialog with a spinning wheel
	 * 
	 */
	public void show() {
		dialog.show();
	}
	
	/**
	 * dismisses the progress wheel dialog
	 */
	public void dismiss() {
		dialog.dismiss();
	}
}
